﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DEEBCG.ExternalLib.CompanyAPI.Model
{
    /// <summary>
    /// 结果信息
    /// </summary>
    public class ResultInfo<T>
    {
        public ResultInfo()
        {

        }

        public ResultInfo(int status, string msg)
        {
            Status = status;
            Msg = msg;
        }

        public ResultInfo(int status, string msg, T data)
        {
            Status = status;
            Msg = msg;
            Data = data;
        }

        /// <summary>
        /// 执行状态代码
        /// </summary>
        public int Status
        {
            get;
            set;
        }


        /// <summary>
        /// 包含数据
        /// </summary>
        public T Data
        {
            get;
            set;
        }

        /// <summary>
        /// 包含消息
        /// </summary>
        public string Msg
        {
            get;
            set;
        }
    }

    /// <summary>
    /// 分页结果数据信息
    /// </summary>
    public class PageDataInfo<T>
    {
        public PageDataInfo()
        {

        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="currentPage">当前页码</param>
        /// <param name="totalRecords">总记录条数</param>
        /// <param name="pageSize">分页大小</param>
        /// <param name="data">包含数据</param>
        public PageDataInfo(int currentPage, long totalRecords, int pageSize, T data)
        {
            CurrentPage = currentPage;
            TotalCount = totalRecords;
            PageSize = pageSize;
            Data = data;
        }



        /// <summary>
        /// 当前页码
        /// </summary>
        public int CurrentPage
        {
            get;
            set;
        } = 1;

        /// <summary>
        /// 总记录条数
        /// </summary>
        public long TotalCount
        {
            get;
            set;
        }

        /// <summary>
        /// 分页大小
        /// </summary>
        public int PageSize
        {
            set;
            get;
        }

        /// <summary>
        /// 包含数据
        /// </summary>
        public T Data
        {
            get;
            set;
        }
    }
}
